namespace ETestIT.Data
{
    using Core;
    using Core.DataInterfaces;
    using NHibernate.Criterion;
    using SharpArch.Data.NHibernate;

    public class UserRepository : Repository<User>, IUserRepository
    {
        public User LogIn(string user, string password)
        {
            var criteria = Session.CreateCriteria<User>()
                .Add(Restrictions.Eq("Name", user))
                .Add(Restrictions.Eq("Password", password));

            return criteria.UniqueResult<User>();
        }
    }
}